import { http } from "../http";
import {ref} from 'vue';
import {Category} from "../interface/category.interface";

export function useCategories() {
  const categories = ref([] as Category[]);
  async function getCategories() {
    categories.value = (await http.get("/categories")).data;
  }
  getCategories();
  return {
    categories,
    getCategories,
  };
}

